#include <bits/stdc++.h>
using namespace std;
#define LL long long
int main() {
  LL k;
  cin >> k;
  // cout << sqrt(2 * k+0.25)-0.5;
  // n * (n + 1) / 2 <=k   配方：  (n+0.5)^2 <= 2*k+0.25
  LL n = sqrt(2 * k + 0.25) - 0.5;
  LL t = k - n * (n + 1) / 2;
  if (t == 0) {
    cout << n - 1 << " " << 0;
  } else {
    cout << t - 1 << " " << n - (t - 1);
  }

  return 0;
}